/****************************************************************************
** ui.h extension file, included from the uic-generated form implementation.
**
** If you want to add, delete, or rename functions or slots, use
** Qt Designer to update this file, preserving your code.
**
** You should not define a constructor or destructor in this file.
** Instead, write your code in functions called init() and destroy().
** These will automatically be called by the form's constructor and
** destructor.
*****************************************************************************/

void
FilaWindow::init()
{
	this->filosa = new fila<QString>;
}

void
FilaWindow::destroy()
{
	delete this->filosa;
}

void 
FilaWindow::enablePush()
{
	if ( this->EditPush->text() != "")
	{
		this->BtnPush->setEnabled(true);
	}
	else
	{
		this->BtnPush->setEnabled(false);
	}
}


void
FilaWindow::push()
{
	this->filosa->push ( this->EditPush->text() );
	
	this->EditPush->setText("");
	
	this->updateData();	
}


void 
FilaWindow::pop()
{
	this->filosa->pop();
	
	this->updateData();
}


void 
FilaWindow::updateData()
{
	if (! this->filosa->isEmpty() )
	{
		this->LabelShowFirst->setText( this->filosa->getInfo() );
		
		this->BtnPop->setEnabled(true);
	}
	else
	{
		this->LabelShowFirst->setText("Fila Vazia!");
		
		this->BtnPop->setEnabled(false);
	}
}
